﻿using System.ComponentModel.Composition;
using MEF_Test.Contracts;
using MEF_Test.VideoRenderer.PlaybackControl.View;

namespace MEF_Test.VideoRenderer.PlaybackControl
{
    [Export(typeof(IPlaybackControlsViewFactory))]
    public class PlaybackControlsViewFactory : IPlaybackControlsViewFactory
    {
        private IPlaybackControlsViewModelFactory _playbackControlsViewModelFactory;

        [ImportingConstructor]
        public PlaybackControlsViewFactory(IPlaybackControlsViewModelFactory playbackControlsViewModelFactory)
        {
            _playbackControlsViewModelFactory = playbackControlsViewModelFactory;
        }

        public IPlaybackControlsView Create()
        {
            var viewModel = _playbackControlsViewModelFactory.Create();
            return new PlaybackControlsView(viewModel);
        }
    }
}
